#!/bin/bash

LOGFILE=udtclient.log

if [ $# -gt 0 ]
then
	LOGFILE=$1
fi

# extract send period and send rate from send statiscs
sed -n '/Send/,+2p' $LOGFILE |sed '/Send/d'|awk '{print $4,$5}' > send.sawk

# extract bandwidth from recv statics 
sed -n '/Recv/,+2p' $LOGFILE |sed '/Recv/d'|awk '{print $8}' > recv.sawk
